package com.zhiyume.controller;

import com.zhiyume.api.util.ApiClassifyEnum;
import com.zhiyume.dao.entity.TAdminSys;
import com.zhiyume.dao.entity.TCmsHome;
import com.zhiyume.service.CmsHomeService;
import com.zhiyume.service.util.DateUtil;
import com.zhiyume.shiro.AdminSecurityManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by wang on 18/3/6.
 */
@Controller
@RequestMapping("/cmsLevel")
public class CmsLevelController extends CmsHomeController{

    @RequestMapping("/addCmsLevel")
    @ResponseBody
    public Map addCmsLevel(TCmsHome cmsLevel){
        return addCmsHome(cmsLevel);
    }

    @RequestMapping("/cmsLevelAddPage")
    public ModelAndView CmsHomeListPage(){
        ModelAndView modelAndView = new ModelAndView();
        // 栏目下拉列表
        List navList = ApiClassifyEnum.getNavList();

        // 楼层下拉列表
        modelAndView.addObject("navList", navList);

        modelAndView.addObject("cmsLevel",new TCmsHome());
        modelAndView.setViewName("page/cmsLevel/cmsLevelAdd");
        return modelAndView;
    }

}
